<!DOCTYPE html>
<html lang='en'>
<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>
<body>
    <div id='app'>
        {{msg | qq(123)}}=====
        <p v-aa>1111111</p>

        ====================
        <form action="">
            <input type="text" v-model.number='a'>+
            <input type="text" v-model.number='b'>={{sub}}==={{total}}
        </form>
    </div>
    <script type='text/javascript'>
        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue',
                a:11,
                b:22,
                sub:0
            },
            directives:{
                aa:{
                    bind(){},
                    inserted(el){
                        el.style.color='red'
                    }
                }
            },
            filters:{
                qq(message,data){
                    return  message.replace('Vue','World'+data)
                }
            },
            watch:{
                a(){
                    this.sub=this.a+this.b
                },
                b(){
                    this.sub=this.a+this.b
                }
            },
            computed:{
                total(){
                    return this.sub=this.a+this.b
                }
            }
        });
    </script>
</body>
</html>